package lab02.Text27;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/2.
 */
public class Text {
    public static void main(String[] args) {
        int a=0;
        //  从键盘输入整数;
        Scanner scanner = new Scanner(System.in);
        System.out.println("please input an int：");

    try{
        a=scanner.nextInt();
        }
        catch(InputMismatchException e)
        {
        System.out.println("类型不匹配");

        }finally
    {
        System.out.println("a="+a);
        }
    }
}
/**
 1.那些代码会出错；try{}
 2.会出什么样的错误；catch(){}
 3.出错了如何解决；finally{}
 **/